package com.internetCafes.spms.web.customer.service.impl.customer;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import com.internetCafes.spms.web.customer.entity.customer.Customer;
import com.internetCafes.spms.web.customer.entity.customer.CustomerCooperation;
import com.internetCafes.spms.web.customer.mapper.customer.CustomerCooperationMapper;
import com.internetCafes.spms.web.customer.model.customer.cooperation.CustomerCooperationDo;
import com.internetCafes.spms.web.customer.model.customer.cooperation.CustomerCooperationPagingDo;
import com.internetCafes.spms.web.customer.model.customer.cooperation.CustomerCooperationPagingPo;
import com.internetCafes.spms.web.customer.model.customer.cooperation.CustomerCooperationPo;
import com.internetCafes.spms.web.customer.service.customer.ICustomerCooperationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 客户合作表 服务实现类
 * </p>
 *
 * @author Zj
 * @since 2021-10-20
 */
@Service
public class CustomerCooperationServiceImpl extends ServiceImpl<CustomerCooperationMapper, CustomerCooperation> implements ICustomerCooperationService {

    @Override
    public List<CustomerCooperationPo> countCooperation(CustomerCooperationDo cooperationDo) {
        return baseMapper.countCooperation(cooperationDo);
    }

    @Override
    public Page<CustomerCooperationPagingPo> paging(Page<CustomerCooperation> page, CustomerCooperationPagingDo pagingDo) {
        return baseMapper.paging(page, pagingDo);
    }

    @Override
    public boolean removeByCustomerIdList(List<Long> customerIdList) {
        return remove(new LambdaQueryWrapper<CustomerCooperation>().in(CustomerCooperation::getCustomerId, customerIdList));
    }
}
